package is.progetto2.gui;

import is.progetto2.activity.Activity;
import is.progetto2.activity.Job;

import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;

public class JobListModel extends AbstractListModel<Job> implements ComboBoxModel<Job>{

	private static final long serialVersionUID = -492894757331486104L;
	private Activity activity;
	private Object select;
	
	public JobListModel(Activity a){
		this.activity=a;
	}
	
	@Override
	public Job getElementAt(int arg0) {
		return activity.getJob(arg0);
	}

	@Override
	public int getSize() {
		return activity.getJobSize();
	}

	@Override
	public Object getSelectedItem() {
		return this.select;
	}

	@Override
	public void setSelectedItem(Object arg0) {
		this.select=arg0;
	}

}
